package com.book_management.component;

import lombok.ToString;

/**
 * @ClassName ErrorCode
 * @Description 常见错误tostring输出
 * @Author XiangQian
 * @Date 2022/7/7 15:37
 */

@ToString
public enum ErrorCode {
    /**
     * 常用报错
     */
    LoginSuccess("200", "登陆成功!"),
    LoginFail_ParamHasEmpty("500", "登录失败，账号或密码为空!"),

    LoginFail_ParamHasError("500", "登录失败，账号或密码为错误!"),
    RegisterSuccess("200", "注册成功!"),
    RegisterFail_ParamHasEmpty("500", "注册错误，账号或密码为空!"),

    RegisterFail_ParamHasError("500", "注册错误，请输入正确的手机号码与邮箱地址!"),
    RegisterFail_AccountHasExist("500", "注册错误，该用户名或手机号已注册!"),
    ProhibitUserSuccess("200", "禁止用户成功!"),

    ProhibitUserFail_ParamHasEmpty("500", "禁止用户失败，Id都不能为空!"),
    ProhibitUserFail_ResultIsZero("500", "禁止用户失败，当前用户不存在"),
    DeleteUserSuccess("200", "删除用户成功!"),

    DeleteUserFail_ParamHasEmpty("500", "删除用户失败，Id不能为空!"),
    DeleteUserFail_ResultIsZero("500", "删除失败，用户不存在或已删除!"),

    INTERNAL_SERVER_ERROR("500", "网络繁忙,服务器异常");
    private final String code;
    private final String message;
    ErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }
    public String getCode(){
    return code;
    }
    public String getMessage() {
        return message;
    }
}